package com.tf.xx.config;

import com.tf.xx.listener.MyContextListener;
import com.tf.xx.listener.MySessionListener;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.logging.Logger;

@Configuration
public class ListenerConfig {

    @Bean
    public ServletListenerRegistrationBean<MyContextListener> myContextListener() {
        return new ServletListenerRegistrationBean<>(new MyContextListener());
    }

    @Bean
    public ServletListenerRegistrationBean<MySessionListener> mySessionListener() {
        return new ServletListenerRegistrationBean<>(new MySessionListener());
    }

}
